package com.free.front.controller.fix;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.deco.domain.vo.store.StoreShopVo;
import com.free.common.vo.ResultModel;
import com.free.front.bf.service.FixGeneralBf;
import com.free.front.bf.service.StoreShopNetBf;
import com.free.front.controller.BaseController;

@Controller
public class FixGeneralController extends BaseController{
    @Autowired
    private FixGeneralBf fixGeneralBf;
    
    @Autowired
    StoreShopNetBf storeShopNetBf;

    
    /**
     * 汽车系统
     * 
     * @param request
     * @return
     */
    @RequestMapping(value ="/carSystem.htm")
    public String carSystem(HttpServletRequest request) {
    	  return getTempleate("/service/carSystem",request);
    }
    
    @RequestMapping(value ="/fixGeneral.htm" )
    public String home(HttpServletRequest request){
        return getTempleate("/service/fixGeneral",request);
    }

    @RequestMapping(value ="/fixGeneralDetail.htm" )
    public String fixGeneralDetail(HttpServletRequest request){
        return getTempleate("/service/fixGeneralDetail",request);
    }
    
    @RequestMapping(value ="/fixGeneralInit.json")
    @ResponseBody
    public ResultModel indexData(){
        return ResultModel.success(fixGeneralBf.getFixGeneralData());
    }

    @RequestMapping(value ="/fixGeneralDetail.json")
    @ResponseBody
    public ResultModel detailInfo(int fixId){
        return ResultModel.success(fixGeneralBf.detailInfo(fixId));
    }

    @RequestMapping(value ="/mfixGeneralDetail.json")
    @ResponseBody
    public ResultModel mdetailInfo(int fixId){
        return ResultModel.success(fixGeneralBf.mdetailInfo(fixId));
    }
    /**
     * 经销商/快修店
     * 
     * @param request
     * @param type
     *            0:经销商,1:快修店
     * @return
     */
    @RequestMapping(value ="/storeShop.htm")
    public String storeShop(HttpServletRequest request) {
    	return getTempleate("/service/storeShop",request);
    }

    @RequestMapping(value = "/shopQuery.json")
    @ResponseBody
    public ResultModel shopQuery(HttpServletRequest request, StoreShopVo shop) {
    	 return ResultModel.success(storeShopNetBf.queryStoreShopData(shop));
    }
    
}
